Skip to content

feat(input): forward DS5 player/mic-LED from libvirtualhid to the client - #5537

Draft
joelfcscoelho wants to merge 1 commit into
LizardByte:masterfrom
joelfcscoelho:ds5-player-mic-led
Draft

feat(input): forward DS5 player/mic-LED from libvirtualhid to the client#5537
joelfcscoelho wants to merge 1 commit into
LizardByte:masterfrom
joelfcscoelho:ds5-player-mic-led

Conversation

@joelfcscoelho

Copy link
Copy Markdown

Description

Follow-up to LizardByte/libvirtualhid#97. Now that libvirtualhid reports
the DualSense player and mic LEDs, this forwards them on to the client so the physical
controller's LEDs follow what the game sets.

Adds two control messages, 0x5504 for the player LED and 0x5505 for the mic LED,
and wires the two new output kinds up to them.

  • common.h: set_player_led / set_mic_led feedback types and their make_* helpers
  • stream.cpp: the two packet types and their encode paths, same as the existing RGB
    LED one (0x5502)
  • virtualhid_input.cpp: forward the player_led / mic_led outputs, reusing the same
    per-value dedup as the RGB case
  • bumps the libvirtualhid submodule to pull in the above

One thing to note: this depends on the libvirtualhid PR, so CI won't pass until that's
merged (the submodule points at its branch). Leaving it a draft until then. Client-side
handling of the two messages is moonlight-common-c#137.

Type of Change

  • feat: New feature (non-breaking change which adds functionality)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@joelfcscoelho
joelfcscoelho marked this pull request as draft August 20, 2026 12:31
Route the new libvirtualhid player_led / mic_led output kinds to the client
via two control-stream messages (0x5504 player LED, 0x5505 mic LED), mirroring
the existing rgb_led passthrough with per-value dedup. Bumps the libvirtualhid
submodule to the commit that surfaces those output kinds.

Signed-off-by: Joel Coelho <joelfernandocscoelho@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.00000% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.47%. Comparing base (3dfbfe0) to head (169135d).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/stream.cpp 20.00% 14 Missing and 2 partials ⚠️
src/platform/common.h 0.00% 12 Missing ⚠️
src/platform/virtualhid_input.cpp 33.33% 8 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5537      +/-   ##
==========================================
- Coverage   32.50%   32.47%   -0.03%     
==========================================
  Files         104      104              
  Lines       25003    25053      +50     
  Branches    11078    11096      +18     
==========================================
+ Hits         8126     8136      +10     
- Misses      13894    13939      +45     
+ Partials     2983     2978       -5     
Flag Coverage Δ
Archlinux 0.00% <0.00%> (ø)
FreeBSD-amd64 18.34% <9.09%> (-0.05%) ⬇️
Homebrew-macos-14 28.00% <0.00%> (-0.11%) ⬇️
Homebrew-macos-15 28.70% <0.00%> (-0.13%) ⬇️
Homebrew-macos-26 28.84% <0.00%> (-0.10%) ⬇️
Homebrew-ubuntu-24.04 19.01% <0.00%> (-0.05%) ⬇️
Linux-AppImage 18.42% <0.00%> (-0.06%) ⬇️
Windows-AMD64 23.72% <0.00%> (-0.08%) ⬇️
Windows-ARM64 20.48% <9.09%> (-0.06%) ⬇️
macOS-arm64 25.29% <9.09%> (-0.08%) ⬇️
macOS-x86_64 25.94% <9.09%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/platform/common.h 53.57% <0.00%> (-5.03%) ⬇️
src/platform/virtualhid_input.cpp 96.04% <33.33%> (-1.58%) ⬇️
src/stream.cpp 21.71% <20.00%> (-0.04%) ⬇️

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3dfbfe0...169135d. Read the comment docs.

@github-actions

Copy link
Copy Markdown
Last Updated 2026-08-21 16:16:45 UTC
Source Run CI Run #5059
Commit 169135dd1dd9dc85cf7c287701b60ccf7c2000d9

Screenshot Comparison

PR #5537 screenshots vs screenshots baseline.

Matrix: AppImage

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-AMD64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-ARM64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-arm64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant